<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        button{
            background-color: aqua;
            width: 200px;
            height: 50px;
            color: darkorchid;
            font-size: 26px;
        }
    </style>
</head>
<body>
    <button>我是个按钮</button>
    <script>
        //获取元素
        document.querySelector('button').onclick = function(){
            console.log('么么哒')
            setTimeout(() => {
                console.log('滚犊子')
            },2000)
};
    </script>>
</body>
</html>